package main

import "fmt"

func cal (n1 int,n2 int) (int) {
	return n1 + n2;
}
func cal2 (n1 int,n2 int) (int,int) {
	return n1 + n2, n1 - n2;
}

func main() {
	var count int = 2
	if count < 30 {
		fmt.Println("数据小鱼30")
	}

	if age:=22;age < 30 {
		fmt.Println("aaaaaaa")
	}

	var sum int = 0
	for i := 0; i < count; i++ {
		sum+=i
	}
	fmt.Println(sum)

	var str string  = "hello go"
	for i := 0; i < len(str); i++ {
		fmt.Printf("%c",str[i])
	}
	fmt.Println()
	for i, v := range str {
		fmt.Printf("索引为：%d,具体的值为：%c \n", i, v)
	}
	fmt.Println(cal(1,2))

	sum1,res1 := cal2(10,20)
	fmt.Println(sum1, res1)
	//_下划线可忽略返回值
	sum2,_ := cal2(10,20)
	fmt.Println(sum2)
}